/*
 * Copyright (c) 2025 iSOFT INFRASTRUCTURE SOFTWARE CO., LTD.
 * easyAda is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */

/**
 * @file    irqn.h
 * @brief   exception and interrupt

 */
#ifndef QEMU_IRQN_H
#define QEMU_IRQN_H

/* WARNING: this header is shared between kernel and rootserver, thus DO NOT inclue any kernel headers. */
enum {
    /* SGI 0 Software Generated Interrupt(0~15), The interrupt is triggered by the CPU writing directly to the corresponding register, which is an inter-core interrupt used in ARM inter-core communication. Similar to IPI in X86
    */
    IRQN_SGI0  = 0,
    IRQN_SGI1  = 1,     // SGI 1
    IRQN_SGI2  = 2,     // SGI 2
    IRQN_SGI3  = 3,     // SGI 3
    IRQN_SGI4  = 4,     // SGI 4
    IRQN_SGI5  = 5,     // SGI 5
    IRQN_SGI6  = 6,     // SGI 6
    IRQN_SGI7  = 7,     // SGI 7
    IRQN_SGI8  = 8,     // SGI 8
    IRQN_SGI9  = 9,     // SGI 9
    IRQN_SGI10 = 10,    // SGI 10
    IRQN_SGI11 = 11,    // SGI 11
    IRQN_SGI12 = 12,    // SGI 12
    IRQN_SGI13 = 13,    // SGI 13
    IRQN_SGI14 = 14,    // SGI 14
    IRQN_SGI15 = 15,    // SGI 15

    IRQN_PRIVATE_PTIMER_EL2 = 26,    // Private physical timer for EL2
    IRQN_PRIVATE_VTIMER_EL1 = 27,    // Private virtual timer for EL1
    IRQN_PRIVATE_PTIMER_EL1 = 30,    // Private physical timer for EL1

    IRQN_UART0 = 33,    // UART0
    IRQN_COUNT,         // IRQN_COUNT must be the last one
};

// SGI8-SGI15 are reserved for secure firmware.
#define NR_IPI IRQN_SGI8

#endif
